home *** CD-ROM | disk | FTP | other *** search
- import java.util.Calendar;
- import java.util.TimeZone;
- import javax.microedition.lcdui.Command;
- import javax.microedition.lcdui.CommandListener;
- import javax.microedition.lcdui.Display;
- import javax.microedition.lcdui.Displayable;
- import javax.microedition.lcdui.Form;
- import javax.microedition.lcdui.StringItem;
- import javax.microedition.lcdui.TextField;
- import javax.microedition.midlet.MIDlet;
- import javax.microedition.midlet.MIDletStateChangeException;
- import javax.microedition.rms.RecordStore;
- import javax.microedition.rms.RecordStoreException;
-
- public class AtomicClock extends MIDlet implements CommandListener {
- // $FF: renamed from: n javax.microedition.lcdui.Display
- private Display field_0 = Display.getDisplay(this);
- // $FF: renamed from: o javax.microedition.lcdui.Command
- private Command field_1;
- // $FF: renamed from: int javax.microedition.lcdui.Command
- private Command field_2;
- // $FF: renamed from: h javax.microedition.lcdui.Command
- private Command field_3;
- // $FF: renamed from: l javax.microedition.lcdui.Command
- private Command field_4;
- // $FF: renamed from: u javax.microedition.lcdui.Command
- private Command field_5;
- // $FF: renamed from: f javax.microedition.lcdui.Command
- private Command field_6;
- // $FF: renamed from: g javax.microedition.lcdui.Form
- private Form field_7 = new Form("Atomic Clock");
- // $FF: renamed from: b c
- private AtomicClock$c field_8 = new AtomicClock$c(this);
- // $FF: renamed from: do a
- private AtomicClock$a field_9 = new AtomicClock$a(this);
- // $FF: renamed from: try b
- private AtomicClock$b field_10;
- // $FF: renamed from: for javax.microedition.lcdui.StringItem
- private static StringItem field_11;
- // $FF: renamed from: p javax.microedition.lcdui.StringItem
- private static StringItem field_12;
- // $FF: renamed from: i javax.microedition.lcdui.TextField
- private static TextField field_13;
- // $FF: renamed from: q javax.microedition.lcdui.TextField
- private static TextField field_14;
- // $FF: renamed from: long java.lang.String
- private static String field_15;
- // $FF: renamed from: t int
- private static int field_16;
- // $FF: renamed from: m int
- private static int field_17;
- // $FF: renamed from: s int
- private static int field_18;
- // $FF: renamed from: goto java.lang.String
- private static final String field_19 = "GMT Offset";
- // $FF: renamed from: char java.lang.String
- private static final String field_20 = "Daylight Saving";
- // $FF: renamed from: c java.lang.String
- private static final String field_21 = "Connecting";
- // $FF: renamed from: void java.lang.String
- private static final String field_22 = "Downloading";
- // $FF: renamed from: null java.lang.String
- private static final String field_23 = "Failed to connect!";
- // $FF: renamed from: k int
- private static int field_24;
- // $FF: renamed from: if int
- private static int field_25;
- // $FF: renamed from: r java.lang.String
- private static String field_26 = "UTC";
- // $FF: renamed from: e java.util.Calendar
- private static Calendar field_27;
- // $FF: renamed from: a java.util.TimeZone
- private static TimeZone field_28;
- // $FF: renamed from: j java.lang.String
- private String field_29;
- // $FF: renamed from: case int
- private int field_30;
- // $FF: renamed from: d int
- private int field_31 = 0;
- // $FF: renamed from: byte boolean
- private boolean field_32;
- // $FF: renamed from: else java.lang.String
- private String field_33;
- // $FF: renamed from: new javax.microedition.rms.RecordStore
- private RecordStore field_34;
-
- public AtomicClock() {
- this.method_6();
- field_11 = new StringItem("", "GMT Offset");
- field_12 = new StringItem("", "Daylight Saving");
- field_13 = new TextField("", field_24 + "", 3, 2);
- field_14 = new TextField("", field_25 + "", 3, 2);
- this.field_1 = new Command("Exit", 7, 1);
- this.field_2 = new Command("Query", 1, 1);
- this.field_4 = new Command("Options", 1, 1);
- this.field_5 = new Command("Status", 1, 1);
- this.field_6 = new Command("About", 1, 1);
- this.field_3 = new Command("Stop", 1, 1);
- this.field_7.addCommand(this.field_1);
- this.field_7.addCommand(this.field_2);
- this.field_7.addCommand(this.field_4);
- this.field_7.addCommand(this.field_5);
- this.field_7.addCommand(this.field_6);
- this.field_7.setCommandListener(this);
- field_28 = TimeZone.getDefault();
- field_27 = Calendar.getInstance(field_28);
- this.field_29 = field_28.getID();
- this.field_30 = field_28.getRawOffset();
- this.field_32 = field_28.useDaylightTime();
- }
-
- public void startApp() throws MIDletStateChangeException {
- this.field_0.setCurrent(this.field_7);
- this.field_8.start();
- this.field_9.start();
- }
-
- public void pauseApp() {
- }
-
- public void destroyApp(boolean var1) {
- AtomicClock.a.access$000(this.field_9);
- this.field_9 = null;
- AtomicClock.c.access$100(this.field_8);
- this.field_8 = null;
- }
-
- // $FF: renamed from: a (int) java.lang.String
- private static String method_0(int var0) {
- return var0 < 10 ? "0" + var0 : "" + var0;
- }
-
- // $FF: renamed from: try () void
- private void method_1() {
- field_27 = Calendar.getInstance(field_28);
- this.field_33 = method_0(field_27.get(11)) + ":" + method_0(field_27.get(12)) + ":" + method_0(field_27.get(13));
- String var1 = "System Time: " + this.field_33 + "\nTime Zone ID: " + this.field_29 + "\nDefault Offset: " + this.field_30 + "\nChosen Offset: " + this.field_31 + "\nDaylight Saving? " + (this.field_32 ? "yes" : "no");
- this.field_7.append(new StringItem("", var1));
- Object var2 = null;
- }
-
- // $FF: renamed from: for () void
- private void method_2() {
- this.field_7.append(field_11);
- this.field_7.append(field_13);
- this.field_7.append(field_12);
- this.field_7.append(field_14);
- field_11.setText("GMT Offset");
- field_12.setText("Daylight Saving");
- field_13.setString(field_24 + "");
- field_14.setString(field_25 + "");
- field_13.setString(field_24 + "");
- field_14.setString(field_25 + "");
- }
-
- // $FF: renamed from: do () void
- private void method_3() {
- this.field_7.append(new StringItem("", "Atomic Clock v1.0.0\nhttp://www.zeroindex.co.uk\ninfo@zeroindex.co.uk"));
- }
-
- // $FF: renamed from: if () void
- private void method_4() {
- int var1 = this.field_7.size();
-
- for(int var2 = 0; var2 < var1; ++var2) {
- this.field_7.delete(0);
- }
-
- }
-
- // $FF: renamed from: int () void
- private void method_5() {
- try {
- field_24 = Integer.parseInt(field_13.getString());
- } catch (NumberFormatException var3) {
- field_24 = 0;
- }
-
- try {
- field_25 = Integer.parseInt(field_14.getString());
- } catch (NumberFormatException var2) {
- field_25 = 0;
- }
-
- if (field_24 > 12 || field_24 < -12) {
- field_24 = 0;
- }
-
- if (field_25 > 12 || field_25 < -12) {
- field_24 = 0;
- }
-
- if (field_24 == 0 && field_25 == 0) {
- field_26 = "UTC";
- } else {
- field_26 = "Local";
- }
-
- this.field_31 = field_24 + field_25;
- }
-
- public void commandAction(Command var1, Displayable var2) {
- this.method_5();
- this.method_7();
- if (var1 == this.field_2) {
- this.method_4();
- this.field_10 = new AtomicClock$b(this);
- field_11 = new StringItem("", "GMT Offset");
- this.field_7.append(field_11);
- this.field_7.append(this.field_10);
- field_11.setText("Connecting");
- this.field_7.removeCommand(this.field_2);
- this.field_7.removeCommand(this.field_4);
- this.field_7.removeCommand(this.field_5);
- this.field_7.removeCommand(this.field_6);
- this.field_7.removeCommand(this.field_1);
- this.field_7.addCommand(this.field_3);
- this.field_10.if();
- AtomicClock.a.access$200(this.field_9);
- } else if (var1 == this.field_4) {
- this.method_4();
- this.method_2();
- } else if (var1 == this.field_5) {
- this.method_4();
- this.method_1();
- } else if (var1 == this.field_6) {
- this.method_4();
- this.method_3();
- } else if (var1 == this.field_3) {
- field_11.setText("");
- if (AtomicClock.a.access$300(this.field_9)) {
- AtomicClock.a.access$400(this.field_9);
- } else {
- AtomicClock.c.access$500(this.field_8);
- }
-
- this.field_7.removeCommand(this.field_3);
- this.field_7.addCommand(this.field_2);
- this.field_7.addCommand(this.field_4);
- this.field_7.addCommand(this.field_5);
- this.field_7.addCommand(this.field_6);
- this.field_7.setCommandListener(this);
- } else if (var1 == this.field_1) {
- AtomicClock.a.access$000(this.field_9);
- AtomicClock.c.access$100(this.field_8);
- this.destroyApp(false);
- ((MIDlet)this).notifyDestroyed();
- }
-
- }
-
- // $FF: renamed from: new () void
- private void method_6() {
- byte[] var1 = new byte[]{0};
- byte[] var2 = new byte[]{0};
-
- try {
- this.field_34 = RecordStore.openRecordStore("atomic", true);
- int var3 = this.field_34.getNumRecords();
- if (var3 == 0) {
- this.field_34.addRecord(var1, 0, 1);
- this.field_34.addRecord(var2, 0, 1);
- } else {
- var1 = this.field_34.getRecord(1);
- var2 = this.field_34.getRecord(2);
- }
- } catch (RecordStoreException var4) {
- this.method_8("problem with initialising offsets\n" + var4);
- }
-
- field_24 = var1[0];
- field_25 = var2[0];
- }
-
- // $FF: renamed from: a () void
- private void method_7() {
- try {
- this.field_34 = RecordStore.openRecordStore("atomic", true);
- byte[] var1 = new byte[]{(new Integer(field_24)).byteValue()};
- byte[] var2 = new byte[]{(new Integer(field_25)).byteValue()};
- this.field_34.setRecord(1, var1, 0, var1.length);
- this.field_34.setRecord(2, var2, 0, var2.length);
- } catch (RecordStoreException var3) {
- this.method_8("problem with setting offset data\n" + var3);
- }
-
- }
-
- // $FF: renamed from: a (java.lang.String) void
- public void method_8(String var1) {
- System.out.println(var1);
- }
-
- // $FF: synthetic method
- static String access$602(String var0) {
- field_15 = var0;
- return var0;
- }
-
- // $FF: synthetic method
- static int access$700() {
- return field_16;
- }
-
- // $FF: synthetic method
- static String access$800(int var0) {
- return method_0(var0);
- }
-
- // $FF: synthetic method
- static int access$900() {
- return field_17;
- }
-
- // $FF: synthetic method
- static int access$1000() {
- return field_18;
- }
-
- // $FF: synthetic method
- static String access$600() {
- return field_15;
- }
-
- // $FF: synthetic method
- static String access$1100() {
- return field_26;
- }
-
- // $FF: synthetic method
- static StringItem access$1200() {
- return field_11;
- }
-
- // $FF: synthetic method
- static int access$1008() {
- return field_18++;
- }
-
- // $FF: synthetic method
- static int access$908() {
- return field_17++;
- }
-
- // $FF: synthetic method
- static int access$1002(int var0) {
- field_18 = var0;
- return var0;
- }
-
- // $FF: synthetic method
- static int access$708() {
- return field_16++;
- }
-
- // $FF: synthetic method
- static int access$902(int var0) {
- field_17 = var0;
- return var0;
- }
-
- // $FF: synthetic method
- static int access$702(int var0) {
- field_16 = var0;
- return var0;
- }
-
- // $FF: synthetic method
- static int access$1300(AtomicClock var0) {
- return var0.field_31;
- }
-
- // $FF: synthetic method
- static AtomicClock$c access$1400(AtomicClock var0) {
- return var0.field_8;
- }
-
- // $FF: synthetic method
- static Command access$1600(AtomicClock var0) {
- return var0.field_1;
- }
-
- // $FF: synthetic method
- static Form access$1700(AtomicClock var0) {
- return var0.field_7;
- }
-
- // $FF: synthetic method
- static AtomicClock$b access$1800(AtomicClock var0) {
- return var0.field_10;
- }
- }
-